<template>
  <div>
    <p class="title">问题反馈列表</p>
    <div class="search-box">
      <el-input class="input" size="small" prefix-icon="el-icon-search" placeholder="搜索热搜名称"></el-input>

    </div>
    <!-- 表格 -->
    <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark">
      <el-table-column label="序号" width="80" prop="num">
        <!-- <template slot-scope="scope">{{ scope.row.date }}</template> -->
      </el-table-column>
      <el-table-column prop="fbTypeName" label="问题反馈类型" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="fbContent" label="问题和意见" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="nickname" label="反馈人">
      </el-table-column>
      <el-table-column prop="fbContact" label="联系方式">
      </el-table-column>
      <el-table-column prop="fbTime" label="反馈时间">
      </el-table-column>

      <el-table-column prop="" label="操作">
        <el-button type="text" slot-scope="scope" @click="toSee(scope.row.fbId)">查看</el-button>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNumber"
      :page-sizes="[100, 200, 300, 400]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
  </div>
</template>

<script>
  import apis from "@/apis/modules/questionType";

  export default {
    data() {
      return {
        keyword : "",
        pageNumber: 1,
        pageSize: 10,
        total: 0,
        tableData: [],

      };
    },
    created() {
      this.getFeedback();
    },
    methods: {
      toSee(fbId){
        this.$router.push({path:'/Home/ProblemInfo?fbId='+fbId})
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      //  反馈列表
      async getFeedback() {
        const { code, data, msg } = await apis.getFeedback({
          pageNumber: this.pageNumber,
          pageSize: this.pageSize
        })
        if (code == 200) {
          this.total = data.count;
          this.tableData = data.list
        }
      },
    },
    // async mounted(){
    //      const res = await apis.getFeedback(this.state, this.pageNumber, this.pageSize).then((res) => {
    //      if (res.code == 200) {
    //        this.tableData = res.data.list;
    //         return res
    //      }
    //    });
    // }
  };
</script>

<style lang="scss" scoped>
  .title {
    margin-bottom: 32px;
  }

  .input {
    width: 400px;
    margin-bottom: 32px;
  }
</style>
